/**
 * 
 */
package com.kingcore.director.reminder.dao.impl;

import java.sql.SQLException;

import org.apache.log4j.Logger;

import wzw.util.StringUtils;

import com.kingcore.director.DirectorConstants;
import com.kingcore.director.base.dao.impl.DirectorDaoJdbcImpl;
import com.kingcore.director.reminder.dao.ReminderDao;

/**
 * @author Zeven
 *
 */
public class ReminderDaoImpl extends DirectorDaoJdbcImpl implements ReminderDao {

	/**
	 *  
	 */
	private static final long serialVersionUID = 1L;
	//log object
	private final static Logger log = Logger.getLogger(ReminderDaoImpl.class);
		
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

	private final String Sql_deleteReminderByIds = "Delete from "+DirectorConstants.RMD_Awoke+" Where id in(${ids})"; 
	@Override
	public void deleteReminderByIds(int[] ids) throws SQLException {
		String str_ids = toCSV(ids);
		log.info( str_ids );
		//this.executeUpdate(Sql_deleteReminderByIds, new Object[]{str_ids}) ; //access2000支持ps有问题？？
		this.executeUpdate( StringUtils.replace(Sql_deleteReminderByIds,"${ids}", str_ids) ) ;
	}

	private final String Sql_disableReminderByIds = "Update "+DirectorConstants.RMD_Awoke+" Set USEFUL='N' Where id in(${ids})"; 
	@Override
	public void disableReminderByIds(int[] ids) throws SQLException {
		String str_ids = toCSV(ids);
		log.info( str_ids );
		//this.executeUpdate(Sql_deleteReminderByIds, new Object[]{str_ids}) ; //access2000支持ps有问题？？
		this.executeUpdate( StringUtils.replace(Sql_disableReminderByIds,"${ids}", str_ids) ) ;
	}

}
